function discountCoupon(input) {
    console.log("exe discountCoupon",input)
    return input*0.8
}

function newComerCoupon(input) {
    console.log("exe newComerCoupon",input)
    return input*0.1
}

function priceBreakDiscountCoupon(input) {
    console.log("exe priceBreakDiscountCoupon",input)
    if (input > 9) {
        return input - 1;
    }
    return input;
}

let map={
    1:discountCoupon,
    2:newComerCoupon,
    3:priceBreakDiscountCoupon
}

let type = 3;
let method = map[type];
let data = method(10);
console.log(data)
